/********************************************************************



Write Date: 2011/03/28
Author: Deng Nianchen
>>>> 
	
*********************************************************************/
#ifndef SOCKET_SERVER_H
#define SOCKET_SERVER_H
#include <iostream>
#include <string>
#include "Global.hpp"
#include "SocketNewConnectionAction.hpp"


_OOPNETWORK_BEGIN

class SocketManager;

class _EXPORT_NETWORK_CLASS SocketListener : public OOPUtils::OOPObject
{

  friend class SocketManager;

private:

  unsigned short _port;
  std::string _ip;
  SOCKET _listenSocket;

  SocketListener (unsigned short port, const std::string & ip);

public:

  virtual ~SocketListener ();
  
  void startListen (SocketNewConnectionAction & action);

};

_OOPNETWORK_END

#endif